package com.zeng.log;

import org.springframework.aop.MethodBeforeAdvice;
import org.springframework.context.annotation.Bean;

import java.lang.reflect.Method;

/**
 * @author zeng
 * @data 2021/06/10 16:53
 */

public class BeforeLog implements MethodBeforeAdvice {
    /**
     *
     * @param method 用执行的方法
     * @param objects 传入的对象
     * @param o 目标对象
     * @throws Throwable
     */
    @Override
    //不能重复地注册Bean
    public void before(Method method, Object[] objects, Object o) throws Throwable {
        System.out.println(method.getName() + "被执行了");
    }
}
